<script>
export default {
	onLaunch: function() {
		let userToken = uni.getStorageSync('userToken');
		if(!(userToken==""||userToken==null||userToken==undefined)){
			var dateEnd = new Date();//获取当前时间
			let diff = dateEnd.getTime()-new Date(userToken.time).getTime();
			if(diff>60*60*24*6*1000){
				this.$request.post("/updateToken", {
					dataType: 'json',
					responseType: 'text'
				})
				.then(res => {
					this.$api.login(res.data.data);
				})
			}
		}
		console.log('App Launch');
	},
	onShow: function() {
		console.log('App Show');
	},
	onHide: function() {
		console.log('App Hide');
	}
};
</script>

<style lang="scss">
/* 解决头条小程序组件内引入字体不生效的问题 */
/* #ifdef MP-TOUTIAO */
@font-face {
	font-family: uniicons;
	src: url('/static/uni.ttf');
}
/* #endif */
	@import "uview-ui/index.scss";
	@import '~@/static/iconfont/iconfont.css';
	body{
		background: #f4f8fb;
	}
	.b-b::after, .b-t::after {
	    position: absolute;
	    z-index: 3;
	    left: 0;
	    right: 0;
	    height: 0;
	    content: '';
	    -webkit-transform: scaleY(0.5);
	    transform: scaleY(0.5);
	    border-bottom: 1px solid #E4E7ED;
	}
	.icon .mix-list-cell.b-b::after {
	    left: 45px;
	}
	.mix-list-cell.b-b::after {
	    left: 15px;
	}
	.b-b::after {
	    bottom: 0;
	}
</style>
